/*
 ============================================================================
 Name        : WebBrowserView.h
 Author      : 
 Version     :
 Copyright   : 
 Description : CWebBrowserView declaration
 ============================================================================
 */

#ifndef WEBBROWSERVIEW_H
#define WEBBROWSERVIEW_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <badesca.h>

class CFont;
class StringSpliteUtility : public CBase
{
public:
    ~StringSpliteUtility();
    StringSpliteUtility();
public:
    void SetFont( const CFont* aFont );
    void SetText( const TDesC& aText );
    void SetWidth( TInt aWidth );
    CDesC16Array& GetTextArray();
private:
    inline int text_width( const TDesC& text );
    TBool CalcTextArray();
private:
    HBufC* iText;
    TInt iWidth;
    const CFont* iFont;
    CDesC16Array* iTextArray;
    int _zeroWidth;
};

int StringSpliteUtility::text_width( const TDesC& text )
{
    return iFont->TextWidthInPixels( text ) + _zeroWidth;
}

#endif // WEBBROWSERVIEW_H
